<script language="Javascript">
	function send(){
		document.getElementById('submit').disabled = (document.getElementById('num').value<=0)?true:false;
	}
</script>
<?php
class Form_SupprimerArticle extends Zend_Form{
	
	
	public function init(){
		$this->setMethod('post');
		$this->setName('supprimerarticle');
		$this->setAttrib('enctype','multipart/form-data');

		$listeVips = ArticleController::listeurarticlevipAction();
		
		$addNom = new Zend_Form_Element_Select('num');
		$addNom ->setLabel('Date de publication : ')
						->setAttrib('onclick', "send();")
						->addMultiOption(0, "Selectionnez un nom ");
		if (!is_null($listeVips)){
		foreach($listeVips as $vip){
			$addNom ->addMultiOption(0-$vip->VIP_NUMERO, $vip->VIP_NOM." ".$vip->VIP_PRENOM);
			$listearticle = ArticleController::listerarticlebyvipnum($vip->VIP_NUMERO);
			foreach($listearticle as $article){
				$addNom ->addMultiOption($article->ARTICLE_NUMERO, " *** ".$article->ARTICLE_DATE_INSERT." *** ");
			}
		}
		}
		
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setLabel('Supprimer');
		
		$this->addElements(array($addNom, $submit));
		
		?>
		<script language="Javascript">
			send();
		</script>
		<?php 	
		
		//On modifie les styles par default
		
		$this->setElementDecorators(array('ViewHelper','Description','Errors',
                   array(array('data'=>'HtmlTag'), array('tag' => 'td')),
                   array('Label', array('tag' => 'td')),
                   array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
        
		$submit->setDecorators(array(
				'ViewHelper','Description','Errors', array(array('data'=>'HtmlTag'),
				array('tag' => 'td','colspan'=>'2','align'=>'left')),
				array(array('row'=>'HtmlTag'),array('tag'=>'tr'))
       ));
       
		
		$this->setDecorators(array('FormElements', array(array('data'=>'HtmlTag'),array('tag'=>'table')),'Form'));
	}
	
}